package com.jarchie.androiddev.ui.item

import androidx.recyclerview.widget.RecyclerView
import com.jarchie.androiddev.R
import com.jarchie.androiddev.model.BannerData
import com.jarchie.androiddev.ui.adapters.ImageAdapter
import com.youth.banner.Banner
import com.youth.banner.indicator.CircleIndicator


class BannerDataItem(val data: List<BannerData>) : CommonDataItem<List<BannerData>, RecyclerView.ViewHolder>(data) {
    override fun onBindData(holder: RecyclerView.ViewHolder, position: Int) {
        val banner = holder.itemView.findViewById<Banner<BannerData, ImageAdapter>>(R.id.banner)
        banner.setAdapter(ImageAdapter(data)).indicator = CircleIndicator(holder.itemView.context)
    }

    override fun getItemLayoutRes(): Int {
        return R.layout.layout_feed_type_banner
    }

}